home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / ifexist.zip / MONOF.ASM < prev    next >
Assembly Source File  |  1987-10-05  |  3KB  |  73 lines

  1. Title   MonOf   Determine type of monitor - 05 Oct 1987 - Davy Crockett
  2.  
  3. ;       ╔═══╦═══════════════════════════════╦═══╗
  4. ;       ║▒▒▒║   Davy Crockett Productions   ║▒▒▒║
  5. ;       ║▒▒▒║   5807 Cherrywood Lane, 104   ║▒▒▒║
  6. ;       ║▒▒▒║   Greenbelt, Maryland 20770   ║▒▒▒║
  7. ;       ╚═══╩═══════════════════════════════╩═══╝
  8.  
  9. RetNear Macro
  10.         DB      0C3H
  11.         Endm
  12.  
  13. Null    Equ     00H
  14. CR      Equ     0DH
  15. LF      Equ     0AH
  16. Parms   Equ     80H
  17.  
  18. Cseg    Segment
  19.         Assume  DS:Cseg, SS:Cseg, CS:Cseg, ES:Cseg
  20.  
  21.         Org     100H
  22.  
  23. MonOf:
  24.         Mov     BX,Parms                ; point to trailer
  25.         Cmp     Byte Ptr [BX],Null      ; anything there?
  26.         Jnz     MonitorOnly             ; yes, skip help message
  27.         Mov     DX,Offset MonHelp       ; point to message
  28.         Mov     AH,09H                  ; display string function
  29.         Int     21H                     ; StdOut
  30.  
  31. MonitorOnly:
  32.         Int     11H                     ; Equipment check
  33.         Mov     CL,4                    ; shift count
  34.         Shr     AX,CL                   ; shift AX register
  35.         And     AX,3                    ; strip extraneous bits
  36.         Cmp     AX,3                    ; monochrome?
  37.         Jz      MonoVideo               ; yes, go set for mono
  38.         Mov     AL,2                    ; no, return color monitor
  39.         Jmp     Short MonOfExit         ; exit stage left
  40. MonoVideo:
  41.         Mov     AL,1                    ; return monochrome
  42.         Jmp     Short MonOfExit         ; exit stage left
  43.  
  44. MonOfExit:
  45.         Mov     AH,4CH                  ; terminate a process
  46.         Int     21H                     ; exit stage left
  47.  
  48. MonHelp         Equ     $
  49.                 DB      CR,LF,LF
  50.                 DB      '«*» MonOf «*» Version 1.0 «*» 05 Oct 1987 '
  51.                 DB      '«*» Davy Crockett «*»',CR,LF,LF
  52.                 DB      'Returns type of monitor in use.',CR,LF,LF
  53.                 DB      '    Execute:  MonOf [garbage]',CR,LF,LF
  54.                 DB      '    [garbage] can be anything to zap this display.'
  55.                 DB      CR,LF,LF
  56.                 DB      '    Return Code = 1, Monochrome Monitor.',CR,LF
  57.                 DB      '    Return Code = 2, Color Monitor.',CR,LF,LF
  58.                 DB      '$'
  59.  
  60. MonOfLen        Equ     (This Byte) - (Offset MonOf)
  61. Filler          Equ     432 - MonOfLen
  62.                 DB      Filler DUP(0)
  63. CopyRight       Equ     $
  64.                 DB      '╔═════════════╗ '
  65.                 DB      '║Davy Crockett║ '
  66.                 DB      '║ Productions ║ '
  67.                 DB      '║ 05 Oct 1987 ║ '
  68.                 DB      '╚═════════════╝'
  69.  
  70. Cseg    Ends
  71.  
  72. End     MonOf
  73.